﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="INGRESOPARTES.aspx.vb" Inherits="IMSS.SA.Formulario_web15" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    .style1
    {
        text-align: center;
    }
    .style2
    {
        text-align: center;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width:100%; color: #FFFFFF; background-color: #006699; background-image: url('../Styles/r3.PNG'); background-repeat: no-repeat;">
    <tr>
        <td class="style2" colspan="2">
            &nbsp;</td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style2" colspan="2">
            <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
        </td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style2" colspan="2">
            &nbsp;</td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style2" colspan="2">
            INGRESE LOS&nbsp; DATOS DE PARTES</td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            ID_PARTES</td>
        <td class="style2">
            <asp:TextBox ID="TexPARTES" runat="server" MaxLength="15"></asp:TextBox>
        </td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            ID_GARANTIAS</td>
        <td class="style2">
            <asp:TextBox ID="TexGARANTIA" runat="server" MaxLength="15"></asp:TextBox>
        </td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            NOMBRE</td>
        <td class="style2">
            <asp:TextBox ID="TexNOMBRE" runat="server" MaxLength="20"></asp:TextBox>
        </td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            TIPO</td>
        <td class="style2">
            <asp:TextBox ID="TextTIPO" runat="server" MaxLength="20"></asp:TextBox>
        </td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            MARCA</td>
        <td class="style2">
            <asp:TextBox ID="TexMARCA" runat="server" MaxLength="20"></asp:TextBox>
        </td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            SERIE</td>
        <td class="style2">
            <asp:TextBox ID="TexSERIE" runat="server" MaxLength="20"></asp:TextBox>
        </td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            CANTIDAD</td>
        <td class="style2">
            <asp:TextBox ID="TexCANTIDAD" runat="server" MaxLength="15"></asp:TextBox>
        </td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            &nbsp;</td>
        <td class="style2">
            &nbsp;</td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            <asp:Button ID="ENVIAR" runat="server" Text="ENVIAR" />
        </td>
        <td class="style2">
            <asp:Button ID="BORRAR" runat="server" Text="BORRAR" />
        </td>
        <td class="style2">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1" colspan="2">
            &nbsp;</td>
        <td class="style1">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1" colspan="2">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="Id_partes" DataSourceID="SqlDataSource1" Width="829px">
                <Columns>
                    <asp:BoundField DataField="Id_partes" HeaderText="Id_partes" ReadOnly="True" 
                        SortExpression="Id_partes" />
                    <asp:BoundField DataField="Id_garantia" HeaderText="Id_garantia" 
                        SortExpression="Id_garantia" />
                    <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                        SortExpression="Nombre" />
                    <asp:BoundField DataField="Tipo" HeaderText="Tipo" SortExpression="Tipo" />
                    <asp:BoundField DataField="Marca" HeaderText="Marca" SortExpression="Marca" />
                    <asp:BoundField DataField="Serie" HeaderText="Serie" SortExpression="Serie" />
                    <asp:BoundField DataField="Cantidad" HeaderText="Cantidad" 
                        SortExpression="Cantidad" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:IMSS.SAConnectionString9 %>" 
                DeleteCommand="DELETE FROM [PARTES] WHERE [Id_partes] = @Id_partes" 
                InsertCommand="INSERT INTO [PARTES] ([Id_partes], [Id_garantia], [Nombre], [Tipo], [Marca], [Serie], [Cantidad]) VALUES (@Id_partes, @Id_garantia, @Nombre, @Tipo, @Marca, @Serie, @Cantidad)" 
                SelectCommand="SELECT [Id_partes], [Id_garantia], [Nombre], [Tipo], [Marca], [Serie], [Cantidad] FROM [PARTES]" 
                UpdateCommand="UPDATE [PARTES] SET [Id_garantia] = @Id_garantia, [Nombre] = @Nombre, [Tipo] = @Tipo, [Marca] = @Marca, [Serie] = @Serie, [Cantidad] = @Cantidad WHERE [Id_partes] = @Id_partes">
                <DeleteParameters>
                    <asp:Parameter Name="Id_partes" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:ControlParameter ControlID="TexPARTES" Name="Id_partes" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TexGARANTIA" Name="Id_garantia" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TexNOMBRE" Name="Nombre" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TextTIPO" Name="Tipo" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TexMARCA" Name="Marca" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TexSERIE" Name="Serie" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TexCANTIDAD" Name="Cantidad" 
                        PropertyName="Text" Type="Decimal" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Id_garantia" Type="String" />
                    <asp:Parameter Name="Nombre" Type="String" />
                    <asp:Parameter Name="Tipo" Type="String" />
                    <asp:Parameter Name="Marca" Type="String" />
                    <asp:Parameter Name="Serie" Type="String" />
                    <asp:Parameter Name="Cantidad" Type="Decimal" />
                    <asp:Parameter Name="Id_partes" Type="String" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </td>
        <td class="style1">
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
</table>
</asp:Content>
